The present invention relates generally to computing systems, and more particularly to a method and apparatus for displaying data.
A document publishing application can be used for producing content (i.e., a document) to be displayed on an output device. Document publishing applications allow a user to manipulate text, graphics, image and other data forming a document for output on a conventional output device. The document can be described in terms of one or more page description language objects that can be process by the output device. The output device can include a raster image processor (RIP) for transferring the page description language objects into data for display on the output device.
Conventional document publishing applications can produce output in one of a plurality of output formats. Depending on the format type, various other devices can view or manipulate the output. As described above, the document produced by conventional document publishing application can include one or more pages of content, each describing in a page description language (PDL). Example of PDLs include the Portable Document Format(trademark) (PDF(trademark)) and PostStcript(copyright) both by Adobe Systems, Inc. of San Jose, Calif. Each page can include instructions for specified one or more objects to be painted on the page including specifying colors for the objects. The color specification includes the definition of a source color space to be associated with the object. The output device on which the document, and hence each object, is viewed or printed may support a different destination color space. If the output device does not support the source color space then a transformation may be required to the destination color space. Typically the transformation occurs in an interpreter resident within the output device. The process for converting color data from one color space to another is known in the art.
During the conversion process hue shifts may result. A hue shift is a color shift change that results when converting from one color space to another. Hue shifts are a concern particularly for certain kinds of objects, one example of which is a gradient. A gradient can be used to produce a smooth color transition over a region. Gradients can be specified by their path and a plurality of colors including a starting color, an ending color and zero or more intermediary colors. In PDF, a gradient is produced by interpolating between the specified colors to produce color data for all the non-specified points in the region. If an incorrect color value is used in the interpolation process, the overall colors in the gradient can change significantly. Upon color conversion, if a color value in a gradient""s specification gets mapped to a visually incorrect value, the effect of the incorrect value spreads out and may become exaggerated producing an unsightly hue shift.
Problems in the conversion can arise where the source color space is not within the gamut of the destination color space. Color coupling is a process of mapping colors in one space (i.e., source space) to colors available in another space (i.e., destination space). However, where the totality of the colors available is less or different between source and destination space, a closest color (e.g., color coupling) is selected. As described above, if the closest color is visually incorrect, undesirable results may be produced in the interpolation process and hue shifts may arise.
In one aspect the invention provides a method for correcting areas of a page that may produce hue shifts when executing a color conversion process on the page from a source color space to a destination color space. The page includes one or more objects including unspecified color points. The method includes determining when a predetermined amount of hue shift will occur in the color conversion process for the object from the source color space to the destination color space. If the amount of hue shift exceeds the predetermined amount, the method includes generating color data for all unspecified color points in the source color space and color converting the object from the source color space to the destination color space.
Aspects of the invention can include one or more of the following features. The object can be a gradient defined by a path and a plurality of color values and the step of generating color data can include interpolating between the color values to derive color data for the unspecified color points.
The step of determining can include color converting the gradient to a third color space, color converting the gradient to the destination color space and color converting the gradient in destination color space to the third color space. In the third color space, a distance between each color point for the representations of the gradient produced in the third color space is measured. If the distance between any two points is greater than a predefined distance, then the color conversion process is determined to exceed the predetermined amount.
The third color space can be the CIE Lab color space. The method can include determining if an approximation of the hue shift should be determined. If an approximation of the hue shift is to be determined then the gamut of the destination color space is mapped to a third color space where the third color space has a gamut that is larger than that of the source color space and the destination color. A range of colors for the gradient in the source color space is determined and mapped to the third color space. If the range of colors for the gradient in the third color space is not coextensive with the gamut of the destination color space in the third color space, then determining that the color conversion exceeds the predetermined amount.
The step of mapping the gamut of the destination space can include mapping the extremities of the axes for the destination color space to the third color space forming a first N-dimensional cube. The step of determining a range of colors for the gradient can include determining a smallest n-dimensional cube that contains all of the color values used in the gradient and color converting the corners of the cube to a third color space forming a second N-dimensional cube. The step of determining if the range of colors for the gradient is coextensive can include determining if the second N-dimensional cube is coextensive with the first N-dimensional cube in the third color space.
The step of determining if an approximation of the hue shift should be determined can include determining if the gradient includes a small number of points having unspecified color data. If the amount of hue shift does not exceed the predetermined amount, the method can include color converting the object from the source color space to the destination color space and generating color data for all unspecified color points in the destination color space.
In another aspect, the invention provides a computer implemented method for correcting areas of an page that may produce hue shifts when executing a color conversion process on the page from a source color space to a destination color space. The page includes one or more objects including unspecified color points. The method includes instructions for causing the computer to determine when a predetermined amount of hue shift will occur in the color conversion process for the object from the source color space to the destination color space. If the amount of hue shift exceeds the predetermined amount, color data for all unspecified color points in the source color space is generated and thereafter the object is color converted from the source color space to the destination color space.
Aspects of the invention can include one or more of the following advantages. A system is provided for determining whether or not unacceptable hue shifts will occur in the color conversion of an object. When unacceptable hue shifts are anticipated then the object is processed in the source color space including performing any interpolation of color data. The resultant images are color converted to the destination color space to reduce the effect of the hue shift producing a more localized result.